function deepClone (obj) {
    if(obj === null ) return null;
    if(typeof obj !== 'object') return obj;
    if(obj instanceof RegExp) return new RegExp(obj);
    if(obj instanceof Date) return new Date(obj);

    let _obj = new obj.constructor;
    for(let key in obj){
        if(obj.hasOwnProperty(key)){
            _obj[key] = deepClone(obj[key])
        }
    }

    return _obj;
}

export default deepClone;